<%@ page language="java" contentType="text/html; charset=UTF-8"	 pageEncoding="UTF-8"%>
<%@ include file="../include/laypublic.jsp"%>
<!DOCTYPE html>
<html>
<head>
  <title>项目工期统计</title>
  <style type="text/css">
  </style>
</head>
<body>
  <div class="layui-fluid">   
    <div class="layui-card">
      <!-- 查询区域  -->
      <div id="query-form" class="layui-form layui-card-header layuiadmin-card-header-auto">
        <div class="layui-form-item">
          <div class="layui-inline">
            	<label class="layui-form-label">公司主体</label>
            	<div class="layui-input-inline" style="width:260px;">
              		<select name="orgTypeAndId" id="query_select_orgId" lay-filter="query_select_orgId" lay-search >
	              		<c:if test="${not empty orgInfos }">
	              			<c:forEach items="${orgInfos}" var="org">
	              				<option value="${org.id}-${org.types}" <c:if test="${org.id == bindOrgId }">selected</c:if>>${org.compName }</option>
		            		</c:forEach>
	              		</c:if>
	              	</select>
            	</div>
          </div>
          <div class="layui-inline">
            	<label class="layui-form-label">项目名称</label>
            	<div class="layui-input-inline">
              		<input type="text" name="orgProName" id="query_input_orgProName"  placeholder="请输入"  autocomplete="off" class="layui-input" >
            	</div>
          </div>
          	<shiro:hasPermission name="LIST_MARCH_COLLECT">
	          <div class="layui-inline">
	            <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-marchCollect-search">
	              <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
	            </button>
	          </div>
          	</shiro:hasPermission>
        </div>
      </div>
      <div class="layui-card-body">
        <table id="LAY-marchCollect-manage" lay-filter="LAY-marchCollect-manage"></table>
      </div>
    </div>
  </div>

  <script>
  var stageJSON = <infopub:dicJson groupNo="A00010077" />;
  	layui.config({
    	base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
  	}).extend({
    	index: 'lib/index' //主入口模块
  	}).use(['index', 'table', 'set', 'laydate', 'element'], function(){
    	var $ = layui.$
    	,form = layui.form
    	,table = layui.table
    	,laydate = layui.laydate
    	,element = layui.element;
    	
    	form.on('select(query_select_orgId)', function(data){
   		 	table.reload('LAY-marchCollect-manage', {page: {curr: 1},
		 		where: {'orgTypeAndId':$('#query_select_orgId').val(),'orgProName':$('#query_input_orgProName').val()}
	      	});
   			
    	});
    	
    	// 表单
    	table.render({
      		elem: '#LAY-marchCollect-manage'
      		,url: basePath + '/marchCollect/queryDataByCondition' //请求数据接口
      		,where: {'orgTypeAndId':$('#query_select_orgId').val(),'orgProName':$('#query_input_orgProName').val()}
      		,cols: [[
				{type:'numbers', title: '序号',fixed:'left', width: 100, align:'center', rowspan: 2}
				,{field: 'hrOrgAreaName', title: '区域公司',fixed:'left',width: 170, align:'center', rowspan: 2}
				,{field: 'proName', title: '项目名称',fixed:'left',width: 280, align:'center', rowspan: 2}				
				,{field: 'addupPlanRate', title: '开累计划完成率（%）',width: 170, align:'center', rowspan: 2}
				,{title: '建设期和工期（合同约定）', align:'center', colspan: 4}
				,{title: '实际开竣工管理', align:'center', colspan: 7}
				,{field: 'actImageShow', title: '实际形象进度描述',width: 170, align:'center', rowspan: 2}
				],[
					{field: 'buildBeginDate', title: '建设期开始时间',width: 170, align:'center', templet: function(d){
		    		  		return layui.util.toDateString(d.buildBeginDate,"yyyy-MM-dd");
		          		}
		         	}
				   ,{field: 'buildEndDate', title: '建设期结束时间',width: 170, align:'center', templet: function(d){
		    		  		return layui.util.toDateString(d.buildEndDate,"yyyy-MM-dd");
		          		}
		         	}
				   ,{field: 'buildYears', title: '建设期（年）',width: 170, align:'center'}
				   ,{field: 'openDate', title: '开工日',width: 170, align:'center', templet: function(d){
		    		  		return layui.util.toDateString(d.openDate,"yyyy-MM-dd");
		          		}
		         	}
				   ,{field: 'ctrlOpenDate', title: '内控开工日',width: 170, align:'center', templet: function(d){
		    		  		return layui.util.toDateString(d.ctrlOpenDate,"yyyy-MM-dd");
		          		}
		         	}
				   ,{field: 'ctrlEndDate', title: '内控竣工日期',width: 170, align:'center', templet: function(d){
		    		  		return layui.util.toDateString(d.ctrlEndDate,"yyyy-MM-dd");
		          		}
		         	}
				   ,{field: 'finishFlag', title: '竣工状态',width: 170, align:'center', templet: function(d){
		    		  		if(d.finishFlag=='0'){
		    		  			return "未竣工";
		    		  		}else if(d.finishFlag=='1'){
		    		  			return "已竣工";
		    		  		}
		          		}
		         	}
				   ,{field: 'stopDays', title: '停工天数',width: 170, align:'center'}
				   ,{field: 'delayedDays', title: '工期顺延天数',width: 170, align:'center'}
				   ,{field: 'putOffDays', title: '已延误天数',width: 170, align:'center'}
				   ,{field: 'restDays', title: '剩余工期天数',width: 170, align:'center'}
				]]
      		,page: true
      		,limit: 10
    	});
    
    	<shiro:hasPermission name="LIST_MARCH_COLLECT">
	    	//监听搜索
	    	form.on('submit(LAY-marchCollect-search)', function(data){
		      	//执行重载
		      	table.reload('LAY-marchCollect-manage', {page: {curr: 1},
		        	where: trimData(data)
		      	});
	    	});
    	</shiro:hasPermission>
  });
  	
  </script>
</body>
</html>

